package com.ruoyi.project.mgcmanage.service.impl;

import com.ruoyi.project.mgcmanage.domain.MedFactory;
import com.ruoyi.project.mgcmanage.mapper.MedFactoryMapper;
import com.ruoyi.project.mgcmanage.service.IMedFactoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class MedFactoryServiceImpl implements IMedFactoryService {
    @Autowired
    private MedFactoryMapper medFactoryMapper;
    @Override
    public List<MedFactory> showList(MedFactory medFactory) {

        return medFactoryMapper.selectAll(medFactory);
    }

    @Override
    public int addProducer(MedFactory medFactory) {
        return medFactoryMapper.insert(medFactory);
    }

    @Override
    public MedFactory selectById(int id) {
        return medFactoryMapper.selectOne(id);
    }

    @Override
    public int updateProducer(MedFactory medFactory) {
        medFactory.setUpdateTime(new Date());
        return medFactoryMapper.update(medFactory);
    }

    @Override
    public int deleteById(int[] facIds) {
        return medFactoryMapper.delete(facIds);
    }

    @Override
    public List<MedFactory> selectAll() {
        return medFactoryMapper.selectByName();
    }
}
